package com.abapi.pay.admin.controller;

import com.abapi.cloud.common.protocol.Result;
import com.abapi.pay.admin.support.db.dto.request.BackInfoQueryDTO;
import com.abapi.pay.admin.support.db.service.PayBackInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author ldx
 * @Date 2020/2/2 15:28
 * @Description
 * @Version 1.0.0
 */
@Controller
@RequestMapping("admin/pay")
public class PayBackInfoController {

    @Autowired
    PayBackInfoService payBackInfoService;

    @RequestMapping("v1/backInfoList")
    public String backInfoList(Model model){
        System.out.println("----------backInfoList---------");
        return "backInfo-list";
    }

    @RequestMapping("v1/query.json")
    @ResponseBody
    public Result query(@ModelAttribute BackInfoQueryDTO queryDTO, HttpServletRequest request){
        return payBackInfoService.query(queryDTO,request);
    }

}
